package com.cmict.data.infra.push;

import com.cmict.data.infra.controller.admin.message.vo.NotifyInfo;
import com.cmict.data.infra.enums.message.NotifyChannelEnum;
import com.cmict.data.system.api.user.dto.AdminUserRespDTO;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 短信通知发布
 *
 * @author Hccake 2020/12/21
 * @version 1.0
 */
@Service
public class SmsNotifyPusher implements NotifyPusher {

//	@Autowired
//	private SmsChannelProducer smsChannelProducer;

	/**
	 * 当前发布者对应的接收方式
	 * @see NotifyChannelEnum
	 * @return 推送方式
	 */
	@Override
	public Integer notifyChannel() {
		return NotifyChannelEnum.SMS.getValue();
	}

	@Override
	public void push(NotifyInfo notifyInfo, List<AdminUserRespDTO> userList) {
//		List<String> phoneList = userList.stream().map(AdminUserRespDTO::getPhone).filter(StrUtil::isNotBlank)
//				.collect(Collectors.toList());
		// 短信文本去除 html 标签
//		String content = HtmlUtils.toText(notifyInfo.getContent());
//		// TODO 对接短信发送平台
//		smsChannelProducer.sendSmsSendMessage();
//		System.out.println("短信推送");
	}

}
